 <#include "../../common/com.html"/> <@layout>

<!-- ace styles -->
<link rel="stylesheet" href="${ctx}/static/assets/css/ace.min.css" />

<script type="text/javascript">
	/**
	 * 新增
	 */
	function saveModel() {
		var id = document.getElementById("id").value;
		if (Validator.Validate(document.getElementById('form1'))) {
		} else {
			return;
		}

		url = '';
		if (id == "") {
			url = '${ctx}/hyglFwgl/save';
		} else {
			url = '${ctx}/hyglFwgl/update';
		}
		$('#form1').form('submit', {
			url : url,
			onSubmit : function() {
				return $(this).form('validate');
			},
			success : function(data) {
				alert(data);
                parent.location.reload();
			}
		});

	}
</script>
<div class="page-content">
	<div class="row-fluid">
		<div class="span12">
			<form class="form-horizontal" id="form1" method="post">
				<input type="hidden" name="id" id="id">
				<div class="control-group">
					<label class="control-label">服务种类:</label>
					<div class="controls">
						<input id="fwzl" name="fwzl" type="text" style="min-height: 24px;" />
					</div>
				</div>
				<div class="control-group">
					<label class="control-label">服务价格:</label>
					<div class="controls">
						<input id="fwjg" name="fwjg"  class="easyui-numberbox" precision="1" type="text" style="min-height: 24px;" />
					</div>
				</div>
				
				<div class="control-group">
						<label class="control-label">提成方式：</label>
						<div class="controls">
							<select name="sptcfs" id="sptcfs">
								<option value="" >无</option>
								<option value="1" selected>按销售比例提成</option>
								<option value="2">按件提成</option>
							</select>
						</div>
					</div>
				<div class="control-group">
					<label class="control-label">工人提成:</label>
					<div class="controls">
						<input id="grtc" class="easyui-numberbox" precision="1"
							name="grtc" type="text" style="min-height: 24px;" />
					</div>
				</div>

			<div class="control-group">
						<label class="control-label">销售状态：</label>
						<div class="controls">
							<select name="yxbz" id="yxbz">
								<option value="1" selected>有效</option>
								<option value="0">停止销售</option>
								<option value="2">折价销售</option>
								
							</select>
						</div>
					</div>

			</form>
		</div>
		<div class="span12 center">
			<a class="btn btn-info btn-small" onclick="saveModel()">确定</a>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <a href="#" class="btn btn-danger btn-small bigger-110"
				onclick="parent.closeDialog();">取消 </a>
		</div>
	</div>
</div>

</body>

<script>
	/**
	 * 修改页面使用
	 */

	<#list newlist as m>
	document.getElementById("fwzl").value = '${(m.fwzl)!}';
	document.getElementById("fwjg").value = '${(m.fwjg)!}';
	document.getElementById("grtc").value = '${(m.grtc)!}';
    document.getElementById("id").value = '${(m.id)!}';
    document.getElementById("yxbz").value = '${(m.yxbz)!}';
    document.getElementById("sptcfs").value = '${(m.sptcfs)!}';

    </#list>
</script>
</@layout>
